package zut.edu.cs.network.io.readerwriter;

import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;

public class FileReaderDemo {

	public static void main(String[] args) {
		try {
			FileReader file = new FileReader("test.txt");
			int s;
			while((s = file.read())!=-1) {
				System.out.print((char)s);
			}		
			file.close();
			
		} catch (FileNotFoundException e) {
			System.out.println("文件不存在！");
			e.printStackTrace();
		} catch (IOException e) {
			System.out.println("读取错误");
			e.printStackTrace();
		}

	}

}
